package com.xjgzinfo.usdp.service.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.Lob;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.Instant;

/**
 * A DTO for the {@link com.xjgzinfo.usdp.domain.ImgAssets} entity.
 */
@ApiModel(description = "图片资源")
public class ImgAssetsDTO implements Serializable {

    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long id;

    /**
     * 图片名称
     */
    @NotNull
    @Size(max = 50)
    @ApiModelProperty(value = "图片名称", required = true)
    private String name;

    /**
     * 类别
     */
    @NotNull
    @Size(max = 50)
    @ApiModelProperty(value = "类别", required = true)
    private String type;

    /**
     * 地址
     */

    @ApiModelProperty(value = "地址", required = true)
    @Lob
    private String url;

    /**
     * 上传用户
     */
    @Size(max = 50)
    @ApiModelProperty(value = "上传用户")
    private String createUser;

    /**
     * 上传时间
     */
    @ApiModelProperty(value = "上传时间")
    private Instant createDate;

    /**
     * 是否公开
     */
    @ApiModelProperty(value = "是否公开")
    private Boolean isPublic = true;

    /**
     * 用户ID
     */
    @ApiModelProperty(value = "用户ID")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long userId;

    /**
     * 是否删除
     */
    @ApiModelProperty(value = "是否删除")
    private Integer isDeleted = 0;


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    public Instant getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Instant createDate) {
        this.createDate = createDate;
    }

    public Boolean isIsPublic() {
        return isPublic;
    }

    public void setIsPublic(Boolean isPublic) {
        this.isPublic = isPublic;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Integer getIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(Integer isDeleted) {
        this.isDeleted = isDeleted;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof ImgAssetsDTO)) {
            return false;
        }

        return id != null && id.equals(((ImgAssetsDTO) o).id);
    }

    @Override
    public int hashCode() {
        return 31;
    }

    // prettier-ignore

    @Override
    public String toString() {
        return "ImgAssetsDTO{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", type='" + type + '\'' +
                ", url='" + url + '\'' +
                ", createUser='" + createUser + '\'' +
                ", createDate=" + createDate +
                ", isPublic=" + isPublic +
                ", userId=" + userId +
                ", isDeleted=" + isDeleted +
                '}';
    }
}
